<div index="<?php echo $index ?>" <?php if($otype == 'pr') echo "type='pr'";?> class="control-group">
    <?php if($otype == 'pr'){?>
		<div class="controls">
			<div class="input-append">
				<input type="hidden" name="otypes[]" value="pr"/>
				<input name="labels[]" type="text"/><button index="<?php echo $index;?>" class="btn btn-danger btn-delete-answer" type="button">Xoá</button>
				<select data-rel="chosen">
				<?php foreach($prlist as $pr){ ?>
					<option><?php echo $pr->province_name;?></option>
				<?php };?>
				</select>
			</div>
		</div>
	<?php }else if($otype == 'rt'){?>
		<label class="control-label">Lựa chọn khác</label>
		<div class="controls">
			<div class="input-append">
				<input disabled="true" type="radio"/>
				<input type="hidden" name="otypes[]" value="rt"/>
				<input name="labels[]" type="text"/><button index="<?php echo $index;?>" class="btn btn-danger btn-delete-answer" type="button">Xoá</button>
			</div>
		</div>
	<?php }else if($otype == 'ct'){?>
		<label class="control-label">Lựa chọn khác</label>
		<div class="controls">
			<div class="input-append">
				<input disabled="true" type="checkbox"/>
				<input type="hidden" name="otypes[]" value="ct"/>
				<input name="labels[]" type="text"/><button index="<?php echo $index;?>" class="btn btn-danger btn-delete-answer" type="button">Xoá</button>
			</div>
		</div>
	<?php }else{?>
		<div class="controls">
			<div class="input-append">
				<?php if($otype == 'r'){ ?>
					<input disabled="true" type="radio"/>
					<input type="hidden" name="otypes[]" value="r"/>
					<input name="labels[]" type="text"/><button index="<?php echo $index;?>" class="btn btn-danger btn-delete-answer" type="button">Xoá</button>
				<?php }else if($otype == 'c'){ ?>
					<input disabled="true" type="checkbox"/>
					<input type="hidden" name="otypes[]" value="c"/>
					<input name="labels[]" type="text"/><button index="<?php echo $index;?>" class="btn btn-danger btn-delete-answer" type="button">Xoá</button>
				<?php }else if($otype == 't'){ ?>
					<input type="hidden" name="otypes[]" value="t"/>
					<input name="labels[]" type="text"/><button index="<?php echo $index;?>" class="btn btn-danger btn-delete-answer" type="button">Xoá</button>
				<?php } ?>
			</div>
		</div>
	<?php };?>
</div>
    <script type="text/javascript">
        $(document).ready(function(){
            //delete answer template
            $('.btn-delete-answer').click(function(){
                var i = $(this).attr('index');
                $('div[index=' + i + ']').remove();
            });
        });
    </script>